/*************************************************************************
	> File Name: oj-537.cpp
	> Author: Wang Bo
	> Mail: 1276106221@qq.com
	> Created Time: 2020年12月11日 星期五 20时25分54秒
 ************************************************************************/
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int n, m, cnt, total;
char c[30], tmp[30];

bool checkStr(const string &s) {
    int ycnt = 0, fcnt = 0;
    for (char i : s) {
        if (i == 'a' || i == 'e' || i == 'o' || i == 'u' || i == 'i') {
            ycnt++;
        } else {
            fcnt++;
        }
    }
    return ycnt >= 1 && fcnt >= 2;
}

string genStr() {
    string t = "";
    for (int i = 0; i < n; ++i) {
        t += tmp[i];
    }
    return t;
}

int func(int s, int left) {
    if (left == 0) {
        string t = genStr(); 
        if (checkStr(t)) {
            cout << t << endl;
            total++;
        }
        if (total == 25000) return -1;
        return 0;
    }
    for (int i = s; i < m; ++i) {
        tmp[cnt++] = c[i];
        if(func(i + 1, left - 1) == -1) return -1;
        cnt--;
    }
    return 0;
}

int main() {
    cin >> n >> m;
    for (int i = 0; i < m; ++i) {
        cin >> c[i];
    }
    sort(c, c + m);
    func(0, n);
    return 0;
}
